package com.estun.backroundManagementService.modules.product.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * <p>
 * 产品表
 * </p>
 *
 * @author machine
 * @since 2023-02-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("product")
@ApiModel(value = "Product对象", description = "产品表")
public class Product {

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty(value = "生产线ID")
    private Long productLineId;

    @ApiModelProperty(value = "产品型号ID")
    private Long productModelId;

    @ApiModelProperty(value = "工艺路线ID")
    private Long productCarftId;

    @ApiModelProperty(value = "生产工单ID")
    private String productWorkOrderId;

    @ApiModelProperty(value = "生产排程code")
    private String scheduleCode;

    @ApiModelProperty(value = "产品码")
    private String productNo;

    @ApiModelProperty(value = "上油路板扫码")
    private String upperCode;

    @ApiModelProperty(value = "下油路板扫码")
    private String lowerCode;

    @ApiModelProperty(value = "隔板编码")
    private String middleCode;

    @ApiModelProperty(value = "状态 -1->不合格 0->生产中 1->合格")
    private Integer status;

    @ApiModelProperty(value = "当前所在工位")
    private String stationId;

    @ApiModelProperty(value = "当前所在工位序号(方便统计每个工位的合格下线数)")
    private Integer stationSort;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "报错类型")
    private String wrongType;

    @ApiModelProperty(value = "报错信息")
    private String wrongMessage;

    @ApiModelProperty(value = "报错时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime wrongTime;

    @ApiModelProperty(value = "完成时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime successTime;

    private Integer type;

    private Integer processIndex;

    @ApiModelProperty(value = "主压力电磁阀（绿色）")
    private String emvA;

    @ApiModelProperty(value = "过冷保护电磁阀（蓝色）")
    private String emvB;

    @ApiModelProperty(value = "离合器电磁阀（金属）")
    private String emvC;


    @TableField(exist = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime beginTime;


    @TableField(exist = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;

}
